package com.tanhua.model.vo;

import com.tanhua.model.domain.UserInfo;
import com.tanhua.model.mongo.Rideo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;

/**
 * @author SunSun
 * @date 2021/11/7
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class RideoVo implements Serializable {
    private Long id;
    private String avatar; //头像
    private String nickname; //昵称

    private String gender; //性别
    private Integer age; //年龄

    private String soundUrl; //语音URL
    private  Integer remainingTimes; //剩余次数

    public static RideoVo init(UserInfo userInfo, Rideo rideo) {
        RideoVo rideoVo=new RideoVo();
        BeanUtils.copyProperties(userInfo,rideoVo);
        rideoVo.setSoundUrl(rideo.getRideoUrl());
        return rideoVo;
    }
}
